Update candidate.py -- normalize each sub-integration independently in subints plot#11
Update candidate.py -- normalize each sub-integration independently in subints plot#11ydejiang wants to merge 1 commit intov-morello:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11 +/- ##
==========================================
- Coverage 93.94% 93.86% -0.09%
==========================================
Files 33 33
Lines 1800 1809 +9
Branches 139 141 +2
==========================================
+ Hits 1691 1698 +7
- Misses 70 71 +1
- Partials 39 40 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @ydejiang, thanks for the MR. I'm happy to merge this feature and perhaps make it a configurable option in the next release of
I suggest something along these lines (using whitening, but you can do the same with peak-to-peak normalisation) means = X.mean(axis=1).reshape(-1, 1)
stddevs = X.std(axis=1).reshape(-1, 1)
stddevs[stddevs == 0] = 1 # My replacement of the `atol` trick
# Note that this does not modify the original input array, this just shadows the X variable name with a new array
X = (X - means) / stddevs |
|
Hi Vincent, thank you so much for the detailed feedback! I tried both whitening and my original peak-to-peak normalisation on several examples. The code is much cleaner now. |
|
@ydejiang Thank you, I always like to talk about code with anyone. Can I ask why you closed the pull request though? I was expecting just one more commit with a better version of the logic and I would have happily merged that. In any case, looking forward to the next one. |
|
Oh, just saw you did open another PR already. All good 😄 |
This PR adds per-subintegration normalization to the subints plot.
Each subint row is now scaled independently to the [0, 1] range.
This improves visibility when a single sub-int contains strong RFI.
Only the normalization step is changed; all plotting logic and layout remain unchanged.